<template>
   <main class="box">
    <div class="container">
      <h1>欢迎使用</h1>

     <todo-add :tid="todos" @add-todo="addTodo" ></todo-add>
     <todo-filter></todo-filter>
     <todo-list :todos="todos"></todo-list>
      
    </div>
  </main>

</template>


<script>
import {ref} from 'vue';
import TodoAdd from "./components/TodoAdd.vue";
import TodoFilter from "./components/TodoFailter.vue";
import TodoList from "./components/TodoList.vue";
export default {
  name: "App",
  components: { TodoAdd, TodoFilter, TodoList },
  set(){
    const todos=ref([]);
    const addTodo=(todo)=> todos.value.push(todo);
    return{
      todos,
      addTodo,
    }
  }
};
</script>





<style>
html,
body {
  margin: 0px;
  padding: 0px;
  font-family: Helvetica, "PingFang SC", "Microsoft Yahei", sans-serif;
  background: rgb(203, 210, 240);
}
.box {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  width: 565px;
  min-height: 400px;
  display: grid;
  align-items: center;
  justify-items: center;
}
.container {
  width: 60%;
  max-width: 400px;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.15);
  border-radius: 24px;
  padding: 48px 28px;
  background-color: rgb(245, 246, 252);
}
h1 {
  margin: 24px 0;
  font-size: 28px;
  color: #414873;
}
</style>
